package com.nineclock.approve.resolver.impl;

import cn.hutool.json.JSONObject;
import com.nineclock.approve.resolver.ProcessNodeResolver;
import com.nineclock.approve.utils.ActivitiUtils;
import com.nineclock.common.utils.UUIDUtils;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.SequenceFlow;
import org.activiti.bpmn.model.StartEvent;

/**
 * 开始节点
 */
public class StartNodeResolver extends ProcessNodeResolver {

    @Override
    public void addFlowNodeToActiviti(Process process, JSONObject currNode, JSONObject nextNode) {
        //绘制开始节点
        StartEvent startEvent = new StartEvent();
        startEvent.setId(getNodeId(currNode));
        startEvent.setName(currNode.getStr("name"));

        process.addFlowElement(startEvent);


        //绘制连线
        addSequenceFlow(process, currNode, nextNode);

    }

}
